package org.come.Jpanel;

import com.tool.btn.BaptizeBtn;
import com.tool.role.RoleData;
import com.tool.role.RoleProperty;
import com.tool.tcp.Sprite;
import com.tool.tcp.SpriteFactory;
import com.tool.tcpimg.ChatBox;
import com.tool.tcpimg.RichLabel;
import com.tool.tcpimg.UIUtils;
import org.apache.commons.lang.StringUtils;
import org.come.Frame.GetLiangHaoJframe;
import org.come.bean.*;
import org.come.entity.Goodstable;
import org.come.model.Eshop;
import org.come.model.Shop;
import org.come.starcard.JpanelStarCardMain;
import org.come.summonequip.JframeSummonEquipMain;
import org.come.summonequip.JpanelSummonEquipMain;
import org.come.until.*;
import org.wing.panel.WingMainFrame;
import org.wing.panel.WingMainPanel;

import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class LiangHaoPreviewJpanel extends JPanel {
	private final ImgZoom imgZoom = CutButtonImage.cuts("inkImg/tupiankuang/lianghao.png", 14, 7, true);
	public LiangHaoPreviewJpanel() {
		this.setPreferredSize(new Dimension(175, 50));
		this.setLayout(null);
		this.setBackground(new Color(0, 0, 0, 0));
	}

    @Override
	public void paint(Graphics g) {
		imgZoom.draw(g);
		LoginResult loginResult = RoleData.getRoleData().getLoginResult();
		Graphics g22 = g.create(0, 5, 175, 50);
		g22.dispose();
		String num = GetLiangHaoJframe.getGetLiangHaoJframe().getGetLiangHaoJpanel().getGetliangHaoTabJpanel().getGetLiangHaoTwoJpanel().getPreViewLiangHao();
		Integer type = 5;
		if (StringUtils.isNotEmpty(num)) {
			String[] nums = num.split("");
			for (int j = 0; j < nums.length; j++) {
				int xnum = 23*loginResult.getRolename().length() + (11 * j);
				int ynum = 17;
				g.drawImage(CutButtonImage.getImage("inkImg/number/" + String.valueOf(type) + nums[j] + ".png", 11, 15).getImage(), xnum, ynum, 11, 15, this);
				g.setFont(new Font("宋体", Font.PLAIN, 14));
				g.setColor(Color.WHITE);
				g.drawString("["+loginResult.getRolename(), 18, 30);
				g.drawString("]", (18*loginResult.getRolename().length()) + (14 * num.length()), 30);
			}
		}

		super.paint(g);
	}

}
